package com.xypower.web.controller;

import com.xypower.pojo.CompanyInfo;
import com.xypower.service.CompanyInfoService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 类名:
 * 作者:XY
 * 创建时间:2021/11/14-14:09
 * 功能:
 */
@RestController
public class CompanyInfoController {
    @Autowired
    private CompanyInfoService companyInfoService;
    @RequestMapping("/getAll")
    public List<CompanyInfo> getAll(){
       return companyInfoService.getAll();
    }

    @GetMapping("/getAllByName")
    public List<CompanyInfo> getAllByName(String compName,String ownerName){
        System.out.println("cname:"+compName+"\t"+ownerName);
        return companyInfoService.getAllByName(compName,ownerName);
    }
}
